package org.ipower.examsystem.service;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

/**
 * 会员科目信息集合。
 * @author jeasonyoung
 */
public class MembershipCatalogInfoCollection implements Serializable,Collection<MembershipCatalogInfo> {
    private List<MembershipCatalogInfo> list = null;
    
    public MembershipCatalogInfoCollection(){
        this.list = new ArrayList<MembershipCatalogInfo>();
    }
    
    public MembershipCatalogInfo get(int index){
        if(index > -1 && index < this.list.size()){
            return this.list.get(index);
        }
        return null;
    }
    
    @Override
    public int size() {
        return this.list.size();
    }

    @Override
    public boolean isEmpty() {
        return this.list.isEmpty();
    }

    @Override
    public boolean contains(Object o) {
         return this.list.contains(o);
    }

    @Override
    public Iterator<MembershipCatalogInfo> iterator() {
        return this.list.iterator();
    }

    @Override
    public Object[] toArray() {
        return this.list.toArray();
    }

    @Override
    public <T> T[] toArray(T[] a) {
        return this.list.toArray(a);
    }

    @Override
    public boolean add(MembershipCatalogInfo e) {
        if(e != null){
            return this.list.add(e);
        }
        return false;
    }

    @Override
    public boolean remove(Object o) {
        if(o != null){
            return this.list.remove(o);
        }
        return false;
    }

    @Override
    public boolean containsAll(Collection<?> c) {
        return this.list.containsAll(c);
    }

    @Override
    public boolean addAll(Collection<? extends MembershipCatalogInfo> c) {
        return this.list.addAll(c);
    }

    @Override
    public boolean removeAll(Collection<?> c) {
        return this.list.removeAll(c);
    }

    @Override
    public boolean retainAll(Collection<?> c) {
        return this.list.retainAll(c);
    }

    @Override
    public void clear() {
        this.list.clear();
    }   
}